function blackbox(obj,event,imgsrc)
{
	var e = coos.event.format(event);
	var obj = obj || null;
	var imgsrc = imgsrc || "../images/coos/blackclose.gif";
	var backDiv = document.createElement("div");
	backDiv.style.cssText = "position: absolute;width: 100%;height:100%;left: 0px;top: 0px;z-index: 10001;";
	backDiv.id = "blackbox_backDiv";
	backDiv.innerHTML = "<div style='width: 100%;height:100%;background-color: #000;filter:alpha(opacity=80); -moz-opacity:0.8;opacity: 0.8;'></div>";
	var closeDiv = document.createElement("div");
	closeDiv.style.cssText = "position: absolute;top:0px;right: 0px;width: 50px;height:50px;background: #000000;z-index: 10005;";
	closeDiv.id = "blackbox_closeDiv";
	closeDiv.innerHTML = '<img src="'+ imgsrc + '" width="18" height="17"/>';
	closeDiv.onclick = function(){
		removeblackbox();
	};
	var boxDiv = document.createElement("div");
	boxDiv.style.cssText = "position: absolute;top:0px;left: 0px;width:100%;height:100%;z-index: 10003;background: #333;";
	boxDiv.id = "blackbox_boxDiv";
	this.removeBox = function()
	{
		document.body.removeChild(coos.$id("blackbox_boxDiv"));
		document.body.removeChild(coos.$id("blackbox_backDiv"));
		document.body.removeChild(coos.$id("blackbox_closeDiv"));
	};
	this.createBox = function()
	{
		if(coos.$id("blackbox_boxDiv"))
		{
			this.removeBox();
		}
		document.documentElement.style.overflowY = "hidden";
		document.body.appendChild(backDiv);
		document.body.appendChild(closeDiv);
		boxDiv.appendChild(obj);
		document.body.appendChild(boxDiv);
		coos.window.fixed.set(closeDiv,0);
		coos.window.fixed();
		boxDiv.style.width = obj.style.width;
		boxDiv.style.height = obj.style.height;
		boxDiv.style.left = ((coos.window.width() - parseInt(boxDiv.style.width,10))/2).toFixed() + "px";
		boxDiv.style.top  = ((coos.window.height() - parseInt(boxDiv.style.height,10))/2).toFixed() + "px";
		coos.$id("blackbox_backDiv").style.width = document.body.scrollWidth + "px";
		coos.$id("blackbox_backDiv").style.height = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight) + "px";
	};
	this.createBox();
}
function removeblackbox()
{
	if(coos.$id("blackbox_boxDiv"))
	{
		document.body.removeChild(coos.$id("blackbox_boxDiv"));
		document.body.removeChild(coos.$id("blackbox_backDiv"));
		document.body.removeChild(coos.$id("blackbox_closeDiv"));
		document.documentElement.style.overflowY = "scroll";
	}
}
